package com.ontheroad.leanCloud.event;

import com.alibaba.fastjson.JSONObject;
import com.ontheroad.leanCloud.model.SessionType;
import org.springframework.context.ApplicationEvent;

import java.util.ArrayList;

/**
 * Created by kedong on 2017/11/14 0014.
 */
public class CreateSessionEvent extends ApplicationEvent {

    private static final long serialVersionUID = 755760035952778029L;

    /**
     * Create a new ApplicationEvent.
     *  @param source      the component that published the event (never {@code null})
     * @param sessionName
     * @param userIds
     * @param type
     * @param json
     * @param id
     */
    public CreateSessionEvent(Object source, String sessionName, ArrayList<Integer> userIds, SessionType type, JSONObject json, Integer id) {
        super(source);
        this.sessionName = sessionName;
        this.userIds = userIds;
        this.type = type;
        this.json = json;
        this.id = id;
    }


    /**
     * 会话名称
     */
    private final String sessionName;

    /**
     * 会话成员的用户ID，这里的用户ID是指的我们自己的数据库里user表的主键
     */
    private final ArrayList<Integer> userIds;

    /**
     * 类型
     * 该会话是从哪个地方创建的
     */
    private final SessionType type;

    private final JSONObject json;
    private final Integer id;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getSessionName() {
        return sessionName;
    }


    public ArrayList<Integer> getUserIds() {
        return userIds;
    }

    public SessionType getType() {
        return type;
    }


    public Integer getId() {
        return id;
    }

    public JSONObject getJson() {
        return json;
    }

}
